package com.miyuan.wm.exception;

import com.miyuan.wm.enums.ExceptionCodeEnum;

public class BaseException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3435701547177097312L;
	
	private Integer code;
	
	private String msg;

	// 给子类用的方法
	public BaseException(ExceptionCodeEnum codeEnum) {
		this(codeEnum.getMsg(), codeEnum.getCode());
	}

	private BaseException(String message, Integer code) {
		this.msg = message;
		this.code = code;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

}
